Methods of error detection
Error check
Errors can occur during data transmission due to:
- interference
- problems during packet switching
- skewing of data
There are a number of ways data can be checked for errors following transmission:
- parity checks
- checksum
- echo check
Parity Check
- Parity checking is one method used to check whether data has been changed or corrupted following data transmission.
- This method is based on the number of 1-bits in a byte of data.
parity bit
- The leftmost bit is the parity bit.
parity bit | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
---|
Even parity
0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
---|
Odd parity
1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
---|
- Before data is transferred, an agreement is made between sender and receiver regarding which type of parity is being used.
- If the number of 1-bits is changed, it means there could be an error.
TIP
- If two of the bits change value following data transmission, it may be impossible to locate the error using parity checking.
- One of the ways round this problem is to use parity blocks.
Parity block
- In this example, nine bytes of data have been transmitted.
- Agreement has been made that even parity will be used.
- Another byte, known as the parity byte, has also been sent.
WARNING
- byte 8 (row 8) now has incorrect parity (there are three 1-bits)
- bit 5 (column 5) also now has incorrect parity (there are five 1-bits).
Checksum
- A checksum is a method used to check if data has been changed or corrupted following data transmission.
- Data is sent in blocks, and an additional value, called the checksum, is sent at the end of the block of data.
Echo check
- With echo check, when data is sent to another device, this data is sent back again to the sender.
- The sender’s computer compares the two sets of data to check if any errors occurred during the transmission process.
Check digit
- A check digit is the final digit included in a code; it is calculated from all the other digits in the code.
The following algorithm generates the check digit from the 12 other digits:
- add all the odd numbered digits together
- add all the even numbered digits together and multiply the result by 3
- add the results from
1
and2
together and divide by 10 - take the remainder, if it is zero then use this value, otherwise subtract the remainder from 10 to find the check digit.
Automatic Repeat Request (ARQ)
An Automatic Repeat Request (ARQ) is a third way used to check data following data transmission.
- ARQ uses positive and negative acknowledgements (messages sent to the receiver indicating that data has/has not been received correctly) and timeout (this is the time interval allowed to elapse before an acknowledgement is received)
- When the receiving device detects an error following data transmission, it asks for the data packet to be re-sent.
- If no error is detected, a positive acknowledgement is sent to the sender.
- The sending device will re-send the data package if it receives a request to re-send the data, or a timeout has occurred.
- The whole process is continuous until the data packet received is correct or until the ARQ time limit (timeout) is reached.